
import { Renderer } from "./states/renderer.ts"
import { UIState } from "./states/ui.ts"
import { SettingState } from "./types.ts"
import { BaseEvent } from 'three'


/**
 * 初始化事件
 */
export class InitEvent implements BaseEvent<EventType> {
  type: EventType = "init"
  constructor(public renderer: Renderer, public detail: UIState) {

  }
}
/**
 * ui事件
 * 即UI状态更新事件
 */
export class UIStateEvent implements BaseEvent<EventType> {
  type: EventType = 'ui'
  constructor(public renderer: Renderer, public detail: UIState) {

  }

}
/**
 * 设置事件
 * 模型加载
 * 控制器切换事件均由此事件表示
 */
export class SettingEvent implements BaseEvent<EventType> {
  type: keyof EventMap = 'setting'
  constructor(public renderer: Renderer, public detail: SettingState) { }

}
export interface EventMap {
  init: InitEvent
  ui: UIStateEvent
  setting: SettingEvent
}
type EventType = keyof EventMap
